<template>
  <div style="text-align: left">
   <el-form ref="form" v-model="form_data" style="margin-left: 30px ">
    <el-form-item label="项目名称" class="el-tem" >
    <el-input  label="20px" v-model="form_data.name" style="height: 500px">
    </el-input>
    </el-form-item >
    <el-form-item label="项目介绍" class="el-tem">
    <el-input  v-model="form_data.des " label="20px">
    </el-input>
<!--    </el-form-item>-->
<!--    <el-form-item label="公共变量">-->
<!--          <el-input placeholder="请输入内容" v-model="form_data.P_data" >-->
<!--            <template slot="prepend">&&&</template>-->
<!--          </el-input>-->
<!--    </el-form-item>-->

<!--         <el-form-item label="加密算法">-->
<!--          <el-input placeholder="请输入内容" v-model="form_data.sign" >-->
<!--            <template slot="prepend">&&&</template>-->
<!--          </el-input>-->
<!--    </el-form-item>-->

<!--    <el-form-item label="mock方式" >-->
<!--    <el-radio-group v-model="form_data.mock">-->
<!--      <el-radio label="mack">默认</el-radio>-->
<!--      <el-radio label="redirect">redirect</el-radio>-->
<!--    </el-radio-group>-->
  </el-form-item>
  <el-form-item label="私密项目" >
    <el-switch v-model="form_data.private"  style="margin-top: 40px;margin-left:-60px"></el-switch>
  </el-form-item>
<!--     <el-form-item label="权限">-->
<!--    <el-checkbox-group v-model="form_data.power">-->
<!--      <el-checkbox label="个人" name="type"></el-checkbox>-->
<!--      <el-checkbox label="同事" name="type"></el-checkbox>-->
<!--      <el-checkbox label="领导" name="type"></el-checkbox>-->
<!--      <el-checkbox label="所有人" name="type"></el-checkbox>-->
<!--    </el-checkbox-group>-->
<!--  </el-form-item>-->
  <el-form-item label="邮箱接收者" class="el-tem">
  <el-input v-model="form_data.Email_to"></el-input>
  </el-form-item>
  <el-form-item label="数据库地址" style="width: 300px">
    <el-input v-model="form_data.Sql_host" style="width: 300px"></el-input>
  </el-form-item>
  <el-form-item label="数据库名字" style="width: 300px">
    <el-input v-model="form_data.Sql_name" style="width: 300px"></el-input>
  </el-form-item>
    <el-form-item label="端口" style="width: 300px">
    <el-input v-model="form_data.Sql_port"></el-input>
  </el-form-item>
  <el-form-item label="用户名" style="width: 300px">
    <el-input v-model="form_data.Sql_user"></el-input>
  </el-form-item>
    <el-form-item label="密码">
    <el-input v-model="form_data.Sql_pwd"
    style="width: 300px;margin-top: 40px;margin-left:-39px"></el-input>
  </el-form-item>


     <el-form-item>

       <a href="?#/Project_list/"><el-button type="primary" @click="save_project">保存并生效

  </el-button></a>
    </el-form-item>
  </el-form>
  </div>
</template>

<script>
import axios from "axios";

export default {
  name: "Pro_ject_set",
  data () {
  return {
    form_data:{
       name:'',
       des:'',
      //  mock:'',
      // private:'',
      //  power:[],
      P_data:'',
      sign:'',
      Email_to:'',
      Sql_host:'',
      Sql_port:'',
      Sql_user:'',
      Sql_pwd:'',
      Sql_name:'',
    }

  }
  },
  methods:{
    save_project(){
      axios.post('http://localhost:8000/save_project/',this.form_data).then(
          this.$message(
              {message:'保存成功',
                      type:'success',
              })
      )
  }
  },
  mounted:function(){axios.get('http://localhost:8000/get_pro_ject_all/',{
    params:{
      id:this.pro_ject_id
    }
  }).then(res=>{this.form_data=res.data})
  },
  props:['pro_ject_id']}
</script>

<style scoped>
.el-tem{
  width:100%;
  height: 90px;
}
</style>